package com.szholly.pro.watergas_server.ps.data;

import java.util.HashMap;

import com.szholly.data.general.Field;
import com.szholly.data.general.GlobalDataType;
import com.szholly.data.general.InterceptorTableBase;
import com.szholly.data.general.metadata.IBaseTable;
import com.szholly.utils.spring.SpringBeanFactory;
import org.springframework.stereotype.Component;
/**
 * SystemOperationLog
 */
@Component("SystemOperationLog")
public class SystemOperationLogTable extends InterceptorTableBase implements IBaseTable {

	public final static String TABLE_NAME = "SYSTEM_OPERATION_LOG";
	
	/**
	 * single ref
	 */
	public static SystemOperationLogTable getSingleRef() {
		return (SystemOperationLogTable) SpringBeanFactory.getBean("SystemOperationLog");
	}

	@Override
	public String getMetadataTableName() {
		return TABLE_NAME;
	}

	@Override
	public String getMetadataTableAliasName() {
		return "SystemOperationLog";
	}

	private HashMap<String, Field> fields;

	@Override
	protected HashMap<String, Field> fields() {
		if (fields == null) {
			fields = new HashMap<String, Field>();

			Field itemField = null;
			
			itemField = new Field();
			itemField.setFieldName(SystemOperationLogRow.FIELD_OperateTime);
			itemField.setDataType(GlobalDataType.DateTime);
			itemField.setFieldID(5);
			itemField.setFieldAliasName("操作时间");
			itemField.setAllowNull(true);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(SystemOperationLogRow.FIELD_Mn);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(6);
			itemField.setFieldAliasName("站点Mn号");
			itemField.setAllowNull(true);
			itemField.setMaxLen(50);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(SystemOperationLogRow.FIELD_ModuleType);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(7);
			itemField.setFieldAliasName("0-污染源  1-地表水 2-工业污染源 3-供水 7-原水 15-质控");
			itemField.setAllowNull(true);
			itemField.setMaxLen(50);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(SystemOperationLogRow.FIELD_Operator);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(8);
			itemField.setFieldAliasName("操作人");
			itemField.setAllowNull(true);
			itemField.setMaxLen(1024);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(SystemOperationLogRow.FIELD_Guid);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(9);
			itemField.setFieldAliasName("GUID");
			itemField.setAllowNull(false);
			itemField.setMaxLen(50);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(SystemOperationLogRow.FIELD_OperateItem);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(10);
			itemField.setFieldAliasName("操作内容");
			itemField.setAllowNull(true);
			itemField.setMaxLen(100);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
		}
		return fields;
	}

	@Override
	public String getTableGroup() {
		return "SystemOperationLog";
	}
}